package lesson3.tests;

import lesson3.api.models.UserModel;

import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

public class LoginTest extends TestBase
{
	@BeforeMethod
	public void logout()
	{
		page().logout();
	}

	@Test
	public void loginWithDataTest()
	{
		UserModel userData = new UserModel();
		userData.login = "babar";
		userData.password = "111111";

		navigation().toIndexPage().login(userData);

		Assert.assertTrue(page().isLoggedIn(), "User is not logged in");
	}

	@Test
	public void loginWithoutDataTest()
	{
		UserModel userData = new UserModel();
		userData.login = "";
		userData.password = "";

		navigation().toIndexPage().login(userData);

		Assert.assertFalse(page().isLoggedIn(), "User is logged in");
	}

}